---
title: SAIF.Application.Claim architecture
summary: Architectural responsibilities, boundaries, and interaction patterns.
status: draft
owner: SAIF Documentation Generator
last_reviewed: 2026-08-21
library: SAIF.Application.Claim
reference_type: embedded
---

# SAIF.Application.Claim architecture

`SAIF.Application.Claim` is the claim-domain application layer: it specializes the domain-neutral `SAIF.Application` manager framework with claim identity, claim retrieval, and claim confidentiality rules, and is in turn specialized by the legal-domain layer (`SAIF.Application.Claim.Legal`). It owns claim context establishment, the fixed claim retrieve/security/save lifecycle, claim confidentiality evaluation, Oracle claim data-portal provisioning, shared claim message vocabulary, and ancillary service handles (imaging API client, claim task generator), while delegating all SQL and persistence logic to referenced business/view libraries.

## Responsibilities
- **Claim context establishment** — `ClaimContext` and the `SetClaimContext`/`SetWorkerContext` entry points define the only supported ways to bind a manager to a claim (claim number, claim id, or worker id); context is immutable once constructed.
- **Claim lifecycle template** — `ChangeContext` fixes the order *retrieve claim → evaluate security → retrieve screen data* for every claim application in the solution, and `Write` fixes the transaction bracket around every claim save.
- **Claim confidentiality evaluation** — `ClaimSecurity` translates claim attributes (`IsWorkerConflict`, `IsExposure`, `IsHealthIssue`, `IsHostileWorker`) plus the user's AD resources into four boolean access flags; `ClaimUserAccess` owns the four claim AD resource names.
- **Oracle claim data-portal provisioning** — `OnCreateDataLayer` creates the `ClaimDPI` Oracle portal with DB user `CLM`, and `DPI(inKey)` makes it the default handle for all downstream business objects.
- **Shared claim message vocabulary** — `ClaimAppConstants` centralizes user-facing strings (claim not found, confidential denial, confirm-delete) reused across the LegalNet managers.
- **Ancillary service handles** — the imaging API client and the claim task generator are created here so every derived claim manager gets them configured identically.

## Component boundaries
- `ClaimAppManager` (`MustInherit`): the abstract claim application-manager base class; owns the context/security/retrieve/write template and is extended by `SAIF.Application.Claim.Legal.LegalManagerBase`.
- `ClaimContext`: immutable value object capturing the current claim/worker identity (`ClaimID`, `ClaimNumber`, `WorkerID`, `ContextSet`).
- `ClaimSecurity`: per-claim access evaluator producing `ConflictAccess`, `ExposureAccess`, `SecureClaimAccess`, and `HealthIssueAccess` flags.
- `ClaimUserAccess` (extends `UserAccess` from `SAIF.Application`): claim-specific AD resource accessor exposing the four claim security resource checks (`SecureClaim`, `ConflictClaim`, `ExposureClaim`, `CollateralHealthClaim`).
- `ClaimAppConstants` (extends `AppConstants` from `SAIF.Application`): claim message/key string constants.
- `Institutions` typed DataSet: an auto-generated, unreferenced banking-institution DataSet carried as a duplicated artifact from a shared project template; not consumed by any code in this library.*
- **No SQL/persistence boundary** — this library never declares an `IBusinessCriteria` or `IDataRequest` and never writes SQL; data retrieval is delegated to `clsClaimData`, `clsEmployeeData`, `ClaimServices` (`SAIF.BOF.Business.View.Claim`), and `clsClaimTaskGenerator` (`SAIF.Business.Tasks.Claim`). It only provisions and hands out the data portal.
- **No legal-domain knowledge** — case, attorney, firm, and schedule concepts live entirely in `SAIF.Application.Claim.Legal`, which inherits from this library.

## Interaction model
- `SAIF.Application.Claim.Legal.LegalManagerBase` and the LegalNet managers inherit `ClaimAppManager` and consume `ClaimSecurity`/`ClaimAppConstants`, invoking `SetClaimContext` to bind a claim and then relying on the inherited retrieve/write pipeline.
- `ClaimAppManager` inherits `AppManagerBase` (`SAIF.Application`), which invokes the protected template hooks (`OnContextChanged`, `OnCheckSecurity`, `OnValidContext`, `OnInitialize`, `OnCreateDataLayer`, `OnTransactionStart`, `OnTransactionStop`) implemented in this library.
- Claim data retrieval and per-claim security-override checks are delegated to `clsClaimData`, `clsEmployeeData`, and `ClaimServices` in `SAIF.BOF.Business.View.Claim` — this library only supplies the Oracle data-portal handle (`ClaimDPI`) those calls execute against.
- Claim task creation/save is delegated to `clsClaimTaskGenerator` in `SAIF.Business.Tasks.Claim`, invoked from `NewTaskGenerator`/`SaveTasks` during a derived manager's `OnWrite()`.
- The imaging service handle (`ClaimImageApiClient`) is built from the `ImagingAPI.Client` package using the `imagingapiurl` Environment API setting, giving derived managers a single, consistently configured imaging client.
- Security decisions are advisory: `OnCheckSecurity` can only downgrade access to `ViewOnly` or `NoAccess`; a derived manager (e.g. `LegalManagerBase`) must call `MarkUpdate()` itself to enable editing.

## Architecture diagram
The following diagram shows how this library sits between the domain-neutral application framework and the legal-domain layer, and which services it delegates to.

```mermaid
flowchart TD
	UI["LegalMaintenance<br>(ASP.NET WebForms)"] --> LEG["SAIF.Application.Claim.Legal<br>LegalManagerBase, LegalNet managers"]
	LEG --> CLM["SAIF.Application.Claim<br>ClaimAppManager, ClaimSecurity,<br>ClaimUserAccess, ClaimContext, ClaimAppConstants"]
	CLM --> APP["SAIF.Application<br>AppManagerBase, UserAccess, ApplicationDataAccess"]
	CLM --> TSKC["SAIF.Business.Tasks.Claim<br>clsClaimTaskGenerator"]
	CLM --> VCLM["SAIF.BOF.Business.View.Claim<br>clsClaimData, clsEmployeeData, ClaimServices"]
	CLM --> IMG["ImagingAPI.Client<br>ImagingClient"]
	APP --> BOF["SAIF.BOF.Framework<br>clsSecurityPrincipal, IDataPortalInfo, data portals"]
```

## Sequence diagram
The following diagram shows the primary claim-context establishment sequence: binding a claim, evaluating security, and retrieving screen data.

```mermaid
sequenceDiagram
	participant UI as Derived manager / UI
	participant CLM as ClaimAppManager
	participant SEC as ClaimSecurity
	participant VCLM as SAIF.BOF.Business.View.Claim
	UI->>CLM: SetClaimContext(claimNumber)
	CLM->>CLM: ChangeContext()
	CLM->>VCLM: clsClaimData.GetData(DPI, claim key)
	VCLM-->>CLM: claim data
	CLM->>SEC: CheckClaim(ClaimData)
	SEC-->>CLM: access flags
	CLM->>VCLM: ClaimServices.HasOverrideAcess(...)
	VCLM-->>CLM: override result
	CLM-->>UI: security role + message
```

## Design constraints
- Every hand-written type is `<Serializable()>`, consistent with WebForms session/view-state persistence of manager state.*
- `ChangeContext` only enforces the conflict-access flag; exposure, hostile-worker, and health-issue flags are computed by `ClaimSecurity` but left for consumers to enforce, and `LegalManagerBase`/`clsCaseSearchManager` do so.
- `OnCheckSecurity` dereferences `ClaimData` without a null guard; whether a worker-only context or a failed `GetClaimData` can reach this path in production is unknown.**
- No SQL, tables, or persistence steps are traced in this library; claim retrieval and override checks are implemented in `SAIF.BOF.Business.View.Claim` and were not traced in this pass.**
- The library is embedded (ProjectReference) in this repository, not packaged; a separate `nuget/` shadow project referencing older framework versions exists but is excluded from `LegalMaintenance.sln` and is treated as a stale artifact.*

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with ** could not be confirmed; treat as unknown until verified.

## Related documentation
- [Index](index.md)
- [Overview](overview.md)
- [Dependencies](dependencies.md)
- [Configuration](configuration.md)
- [Operations and processes](operations-processes.md)
- [Business rules](business-rules.md)
- [Security and authorization](security-authorization.md)
- [API reference](api/index.md)

## Sources
- `SAIF.Application.Claim/SAIF.Application.Claim.vbproj`
- `SAIF.Application.Claim/ClaimAppManager.vb`
- `SAIF.Application.Claim/ClaimAppConstants.vb`
- `SAIF.Application.Claim/ClaimContext.vb`
- `SAIF.Application.Claim/ClaimSecurity.vb`
- `SAIF.Application.Claim/ClaimUserAccess.vb`
- `SAIF.Application.Claim/Institutions.Designer.vb`
- `SAIF.Application.Claim.Legal/LegalManagerBase.vb`
- `SAIF.Application.Claim.Legal/LegalNet/clsCaseSearchManager.vb`
- `SAIF.Business.Tasks.Claim/clsClaimTaskGenerator.vb`
- `SAIF.Application.Claim/AssemblyInfo.vb`
- `SAIF.Application.Claim/Institutions.xsd`
- `SAIF.Application.Claim/app.config`
- `SAIF.Application.Claim/Web.config`
- `SAIF.Application.Claim/packages.config`
